package main

import (
	"log"
	"my-crawler/database/redis"
	"my-crawler/distributed/config"
	"my-crawler/distributed/jsonrpc"
)

func main() {
	//开启RPC 服务器
	log.Fatal(serveRpc(config.TcpPort, "jsonrpc_user2"))
}

func serveRpc(host, redis_key string) error {
	return jsonrpc.ServeRpc(
		host,
		&jsonrpc.ItemSaverService{
			Client:   redis.RedistPool,
			RedisKey: redis_key,
		}, //... 可以在此注册多个服务
	)
}
